import React, {FC, useState} from "react";
import styles from './common.module.scss'
import {Typography,Empty} from "antd";
import {useTitle} from 'ahooks'
import QuestionCard from "../../components/QuestionCard.tsx";
const {Title} = Typography
const rawQuestionList = [
    { _id: 'q1', title: '问卷1', isPublished: false, isStar: true, answerCount: 5, createAt: '5月4日 13:23' },
    { _id: 'q2', title: '问卷2', isPublished: false, isStar: false, answerCount: 3, createAt: '5月4日 13:23' },
    { _id: 'q3', title: '问卷3', isPublished: false, isStar: true, answerCount: 2, createAt: '5月4日 13:23' },
    { _id: 'q4', title: '问卷4', isPublished: true, isStar: false, answerCount: 1, createAt: '5月4日 13:23' },
]
const Star:FC=()=>{
    useTitle('鹏宇问卷 - 星标问卷')
    const [questionList, setQuestionList] = useState(rawQuestionList)
    return <>
        <div className={styles.header}>
            <div >
                <Title level={3}>星标问卷</Title>
            </div>
            <div className={styles.right}>（搜索）</div>
        </div>
        <div className={styles.content}>
            {/*{生成星标问卷列表，没有就是空}*/}
            {questionList.length === 0 && <Empty description="暂无数据 "/>}
            {questionList.length > 0 && questionList.map(q=>{
                const {_id} = q
                return <QuestionCard key={_id} {...q}/>
            })}
        </div>
        <div className={styles.footer}>分页</div>
    </>
}
export default Star